package com.zr.gdms.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zr.gdms.service.ShuRuSelectStudentService;
import com.zr.gdms.serviceimpl.ShuRuSelectStudentServiceimpl;

import net.sf.json.JSONObject;
//输入院系框查询学生信息
public class ShuRuSelectStudentController extends HttpServlet {
				ShuRuSelectStudentService se=new ShuRuSelectStudentServiceimpl();
			@Override
			protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
				// TODO Auto-generated method stub
				doPost(req, resp);
			}
			@Override
			protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
			// TODO Auto-generated method stub
				req.setCharacterEncoding("utf8");
				resp.setCharacterEncoding("utf8");
				HttpSession session=req.getSession();
				PrintWriter pt=resp.getWriter();
				int page=Integer.parseInt(req.getParameter("page"));
				int rows=Integer.parseInt(req.getParameter("rows"));
				String name=req.getParameter("name");
				JSONObject j=se.getShuRuSdepartStudent(name, page, rows);
				pt.write(j.toString());		
				pt.flush();
				pt.close();	
			}	
}	
